home *** CD-ROM | disk | FTP | other *** search
- head 1.7;
- branch ;
- access ;
- symbols ;
- locks ; strict;
- comment @ * @;
-
-
- 1.7
- date 89.07.31.17.51.57; author douglis; state Exp;
- branches ;
- next 1.6;
-
- 1.6
- date 89.07.13.23.24.40; author douglis; state Exp;
- branches ;
- next 1.5;
-
- 1.5
- date 89.05.04.15.49.00; author douglis; state Exp;
- branches ;
- next 1.4;
-
- 1.4
- date 89.03.17.12.42.02; author douglis; state Exp;
- branches ;
- next 1.3;
-
- 1.3
- date 88.11.19.15.53.06; author douglis; state Exp;
- branches ;
- next 1.2;
-
- 1.2
- date 88.11.14.13.28.22; author douglis; state Exp;
- branches ;
- next 1.1;
-
- 1.1
- date 88.09.04.22.37.23; author douglis; state Exp;
- branches ;
- next ;
-
-
- desc
- @declarations internal to the loadavg program.
- @
-
-
- 1.7
- log
- @single '.')
- >> use the kernel idle time by default, but changes to support statting
- if only it would work without requiring exclusive access
- @
- text
- @/*
- * loadAvg.h --
- *
- * Declarations internal to the loadavg program.
- *
- * Copyright 1987 Regents of the University of California
- * All rights reserved.
- *
- *
- * $Header: /a/newcmds/loadavg/RCS/loadavg.h,v 1.6 89/07/13 23:24:40 douglis Exp Locker: douglis $ SPRITE (Berkeley)
- */
-
- #ifndef _LOADAVG
- #define _LOADAVG
-
- #include <time.h>
- #include <db.h>
- #include <mig.h>
- #include <stdio.h>
- #include <stdlib.h>
-
- #include <proc.h>
- #include <kernel/net.h>
-
- /*
- * Subscripts into the queueThreshold array.
- */
- #define MIN_THRESHOLD 0
- #define MAX_THRESHOLD 1
-
- /*
- * Arbitrary value larger than the load average on any node (we hope!)
- */
- #define MAX_LOAD 1000.0
-
- /*
- * Buffer lengths.
- */
- #define HOST_NAME_SIZE 64
- #define MAX_PATH_NAME_LENGTH 1024
-
-
- /*
- * For each machine, keep track of the timestamp for its information and the
- * different load averages reported. Also, the architecture type
- * (e.g., sun2/sun3/spur) is stored to make sure we can migrate to a machine
- * of the same type.
- */
-
- /*
- * If we are not allowing foreign processes, but our time since last input
- * is greater than noInput and our average queue lengths are ALL less than
- * the corresponding values in min, start accepting foreign processes.
- *
- * If we are allowing foreign processes and either the idle time drops
- * or ANY of the average queue lengths exceeds its corresponding value in max,
- * stop accepting them.
- */
-
- typedef struct {
- int noInput;
- double min[MIG_NUM_LOAD_VALUES];
- double max[MIG_NUM_LOAD_VALUES];
- } Thresholds;
-
- typedef enum {
- EVICT,
- CHECK_COUNT
- } FindForeignParam;
-
- /*
- * Global variables. (Options, plus other global vars initialized at startup.)
- */
-
- extern int debug;
- extern int verbose;
- extern int loadInterval;
- extern int writeInterval;
- extern int timeOut;
- extern int neverAccept;
- extern int alwaysAccept;
- extern int migVersion;
- extern int numLowPris;
- extern int useKernelIdleTime;
- extern char *dataFile;
- extern char *weightString;
- extern double weights[];
- extern Thresholds thresholds;
-
- extern int errno;
-
- extern int hostID;
- extern char *myName;
- extern char hostname[];
- extern char *machType;
- extern int kernelState;
- #ifdef INTERIM
- extern int oldKernel;
- #endif /* INTERIM */
-
- /*
- * Procedures.
- */
-
- extern void RunDaemon();
- extern int FindForeign();
-
- extern char *malloc();
- extern char *strcpy();
- extern char *strerror();
- #endif _LOADAVG
-
- @
-
-
- 1.6
- log
- @Don't charge low priority processes against the load average when deciding whether to accept migrations
- @
- text
- @d10 1
- a10 1
- * $Header: /a/newcmds/loadavg/RCS/loadavg.h,v 1.5 89/05/04 15:49:00 douglis Exp Locker: douglis $ SPRITE (Berkeley)
- d84 1
- @
-
-
- 1.5
- log
- @changed to use the kernel state variable for import/export permissions.
- @
- text
- @d1 1
- a1 1
- /*
- d10 1
- a10 1
- * $Header: /a/newcmds/loadavg/RCS/loadavg.h,v 1.4 89/03/17 12:42:02 douglis Exp Locker: douglis $ SPRITE (Berkeley)
- d83 1
- @
-
-
- 1.4
- log
- @added decl. for strerror.
- @
- text
- @d10 1
- a10 1
- * $Header: /a/newcmds/loadavg/RCS/loadavg.h,v 1.3 88/11/19 15:53:06 douglis Exp Locker: douglis $ SPRITE (Berkeley)
- a79 1
- extern int forkChild;
- d94 4
- @
-
-
- 1.3
- log
- @got rid of some obsolete declarations and converted some more over
- to use constants from mig.h.
- @
- text
- @d10 1
- a10 1
- * $Header: /a/newcmds/loadavg/RCS/loadavg.h,v 1.2 88/11/14 13:28:22 douglis Exp Locker: douglis $ SPRITE (Berkeley)
- d105 1
- @
-
-
- 1.2
- log
- @converted to new library, mostly.
- @
- text
- @d1 1
- a1 1
- /*
- d10 1
- a10 1
- * $Header: loadavg.h,v 1.1 88/09/04 22:37:23 douglis Exp $ SPRITE (Berkeley)
- d23 1
- a25 22
- * Define pseudo-RPC protocol for named pipes.
- *
- * LA_RPC_UPDATE - update load statistics for a node
- * LA_RPC_IDLE - get an idle node
- * LA_RPC_ALLINFO - output statistics for all nodes
- */
-
- #define LA_RPC_UPDATE 0
- #define LA_RPC_IDLE 1
- #define LA_RPC_ALL_INFO 2
-
- #define LOAD_NUM_VALUES 3
-
- /*
- * Define constants related to Sprite system characteristics and defaults.
- */
-
- #define STANDARD_OUTPUT 1
- #define OPEN_MODE 0664
- #define MAX_NUM_HOSTS 256
-
- /*
- d32 1
- a32 1
- * Arbitrary value larger than the load average on any node
- d62 2
- a63 2
- double min[LOAD_NUM_VALUES];
- double max[LOAD_NUM_VALUES];
- d66 5
- d81 3
- a83 1
- extern int lockFile;
- d101 1
- a101 2
- extern void RunServer();
- extern ReturnStatus OpenCreate();
- @
-
-
- 1.1
- log
- @Initial revision
- @
- text
- @d4 1
- a4 1
- * Declarations internal to the loadAvg program.
- d10 1
- a10 1
- * $Header: loadAvg.h,v 2.7 88/05/15 21:01:24 douglis Exp $ SPRITE (Berkeley)
- d16 5
- a20 10
- #include "sprite.h"
- #include "status.h"
- #include "io.h"
- #include "mem.h"
- #include "fs.h"
- #include "proc.h"
- #include "time.h"
- #include "byte.h"
- #include "dataBase.h"
- #include "hostInfo.h"
- d22 2
- a46 11
- * A record contains "%2d %3d %10d %10d %3.0f %3.0f %3.0f %5.2f %5.2f %5.2f\n",
- * plus a null byte. (This amounts to 54 bytes.) Make it the next
- * power of 2.
- *
- * Note that after this is debugged, this can be changed to write in binary
- * form rather than converting to ASCII.
- */
-
- #define UTIL_RECORD_SIZE 64
-
- /*
- d57 6
- a70 11
- typedef struct {
- int hostID;
- int archType;
- int utils[LOAD_NUM_VALUES];
- double lengths[LOAD_NUM_VALUES];
- int bootTime;
- int timestamp;
- int noInput;
- Boolean allowMigration;
- } NodeInfo;
-
- d91 2
- a92 2
- extern Boolean debug;
- extern Boolean verbose;
- d96 2
- a97 2
- extern Boolean forkChild;
- extern Boolean lockFile;
- d103 2
- a105 1
- extern int archType;
- d107 2
- d118 2
- @
-